﻿@using VirtualPress.Infrastructure.Entities.Entity;
@{
    Layout = "/Views/Shared/_Simple.cshtml";
}
@section head{
    <link rel="stylesheet" href="/content/css/evalutionform.css" />
    <link rel="stylesheet" href="/content/css/bootstrap.min.css" />
}
@{
    Article article = ViewBag.Article;
    Expert expert = ViewBag.Expert;
    VirtualPress.Infrastructure.Entities.Entity.User expertUser = ViewBag.User;
    Periodical journal = ViewBag.Journal;
    Meeting meeting = ViewBag.Meeting;
    int examineId = ViewBag.ExamineId;
    List<ArticleAuthor> authorList = ViewBag.Authors;
    string authors = string.Empty;
    for (int i = 0, len = authorList.Count; i < len; i++)
    {
        authors += authorList[i].AuthorName;
        if (i != len - 1)
        {
            authors += ", ";
        }
    }
}
<div class="container mini-layout">
    <div class="page-header center">
        @if(journal != null){
            <h3>@journal.Name 审稿单</h3>
        }
        else
        {
            <h3>@meeting.Name 审稿单</h3>
        }
        <div class="left contentrow">
            <div>
                <b>题目：</b>@article.Title</div>
            <div>
                <b>编号：</b>@article.Code</div>
        </div>
    </div>
    <form id="form" action="/home/receivepostdata" method="post" enctype="multipart/form-data">
    <input type="hidden" name="examineId" value="@examineId" />
    <input type="hidden" name="articleId" value="@article.Id" />
    <input type="hidden" name="expert" value="@expert.UserName" />
    <div class="contentrow">
        <div class="container-fluid">
            <div class="control-group container">
                <label class="control-label strong">
                    1、稿件类型</label>
                <div class="controls">
                    <div class="row-fluid">
                        <label class="radio">
                            <input type="radio" name="type" value="科研" />
                            科研
                        </label>
                        <label class="radio">
                            <input type="radio" name="type" value="实验" />
                            实验
                        </label>
                        <label class="radio">
                            <input type="radio" name="type" value="案例研究" />
                            案例研究
                        </label>
                        <label class="radio">
                            <input type="radio" name="type" value="调查" />
                            调查
                        </label>
                        <label class="radio">
                            <input type="radio" name="type" value="教程" />
                            教程
                        </label>
                        <label class="radio">
                            <input type="radio" name="type" value="其他" />
                            其他
                        </label>
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group container">
                <label class="control-label strong">
                    2、总体评价</label>
                <div class="controls">
                    <div class="control-group">
                        <label class="control-label">
                            1) 原创性</label>
                        <div class="controls">
                            <label class="radio">
                                <input type="radio" name="Originality" value="优秀" />
                                优秀
                            </label>
                            <label class="radio">
                                <input type="radio" name="Originality" value="好" />
                                好
                            </label>
                            <label class="radio">
                                <input type="radio" name="Originality" value="一般" />
                                一般
                            </label>
                            <label class="radio">
                                <input type="radio" name="Originality" value="差" />
                                差
                            </label>
                            <label class="radio">
                                <input type="radio" name="Originality" value="很差" />
                                很差
                            </label>
                        </div>
                    </div>
                </div>
            </div>
            <div class="control-group container">
                <label class="control-label">
                    2) 实用性</label>
                <div class="controls">
                    <label class="radio">
                        <input type="radio" name="Usefulness" value="优秀" />
                        优秀
                    </label>
                    <label class="radio">
                        <input type="radio" name="Usefulness" value="好" />
                        好
                    </label>
                    <label class="radio">
                        <input type="radio" name="Usefulness" value="一般" />
                        一般
                    </label>
                    <label class="radio">
                        <input type="radio" name="Usefulness" value="差" />
                        差
                    </label>
                    <label class="radio">
                        <input type="radio" name="Usefulness" value="很差" />
                        很差
                    </label>
                </div>
            </div>
            <div class="control-group container">
                <label class="control-label">
                    3) 技术合理性</label>
                <div class="controls">
                    <label class="radio">
                        <input type="radio" name="Soundness" value="优秀" />
                        优秀
                    </label>
                    <label class="radio">
                        <input type="radio" name="Soundness" value="好" />
                        好
                    </label>
                    <label class="radio">
                        <input type="radio" name="Soundness" value="一般" />
                        一般
                    </label>
                    <label class="radio">
                        <input type="radio" name="Soundness" value="差" />
                        差
                    </label>
                    <label class="radio">
                        <input type="radio" name="Soundness" value="很差" />
                        很差
                    </label>
                </div>
            </div>
            <div class="control-group container">
                <label class="control-label">
                    4) 语言描述</label>
                <div class="controls">
                    <label class="radio">
                        <input type="radio" name="LinguisticQuality" value="优秀" />
                        优秀
                    </label>
                    <label class="radio">
                        <input type="radio" name="LinguisticQuality" value="好" />
                        好
                    </label>
                    <label class="radio">
                        <input type="radio" name="LinguisticQuality" value="一般" />
                        一般
                    </label>
                    <label class="radio">
                        <input type="radio" name="LinguisticQuality" value="差" />
                        差
                    </label>
                    <label class="radio">
                        <input type="radio" name="LinguisticQuality" value="很差" />
                        很差
                    </label>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label strong">
                    3、稿件说明</label>
                <div class="controls">
                    <div class="control-group">
                        <label class="control-label">
                            1) 稿件解决了什么问题？</label>
                        <div class="controls">
                            <textarea rows="4" style="width: 80%" id="tarresolution" name="resolution"></textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            2) 主要领域作出的贡献？</label>
                        <div class="controls">
                            <textarea rows="4" style="width: 80%" id="tarcontribution" name="contribution"></textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            3) 在哪些方面确实缺乏原创？</label>
                        <div class="controls">
                            <textarea rows="4" style="width: 80%" id="taroriginalless" name="originalless"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <label class="control-label strong">
                    4、最终审评</label>
                <div class="controls">
                    <label class="checkbox">
                        <input type="radio" name="verdict" value="0" onclick="triggersuggestion(0)" />
                        推荐接收
                    </label>
                    <label class="checkbox">
                        <input type="radio" name="verdict" value="1" onclick="triggersuggestion(0)" />
                        接收
                    </label>
                    <label class="checkbox">
                        <input type="radio" name="verdict" value="2" onclick="triggersuggestion(1)" />
                        需较小修订
                    </label>
                    <label class="checkbox">
                        <input type="radio" name="verdict" value="3" onclick="triggersuggestion(1)" />
                        需较大修订
                    </label>
                    <label class="checkbox">
                        <input type="radio" name="verdict" value="9" onclick="triggersuggestion(1)" />
                        拒绝
                    </label>
                </div>
                <div id="boxsuggestion" class="control-group" style="display:none;">
                    <label class="control-label">
                    </label>
                    <div class="controls">
                        <textarea placeholder="修订意见/拒绝理由" rows="10" style="width: 80%;" id="tarverdictcontent" name="verdictcontent"></textarea>
                    </div>
                </div>
            </div>
            <hr />
            <div class="control-group">
                <div class="controls">
                    附件<input id="fleExamineSheet" type="file" name="examineSheet" />
                    <div class="help-block">
                        如果您还有相关审稿资料，请通过附件上传！</div>
                </div>
            </div>
        </div>
    </div>
    <div class="contentrow center">
        <input id="btnsubmit" type="submit" value="提交审稿单" class="btn btn-primary" />
    </div>
    </form>
    <div class="contentrow">
        <hr />
        <div class="text-info">
            <span class="text-error">注：</span>审稿专家个人信息将对作者保密，请认真如实填写审稿单；</div>
    </div>
</div>
@section tail
{
    <script type="text/javascript">
        function triggersuggestion(i) {
            if (i == 0) {
                $('#boxsuggestion').hide();
            }
            else {
                $('#boxsuggestion').show();
            }
        }
        $(function () {
            $('#form').submit(function () {
                var type = $('input:radio[name="type"]:checked');
                if (type.length == 0) {
                    $('input:radio[name="type"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="type"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="type"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                var Originality = $('input:radio[name="Originality"]:checked');
                if (Originality.length == 0) {
                    $('input:radio[name="Originality"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="Originality"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="Originality"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                var Usefulness = $('input:radio[name="Usefulness"]:checked');
                if (Usefulness.length == 0) {
                    $('input:radio[name="Usefulness"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="Usefulness"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="Usefulness"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                var Soundness = $('input:radio[name="Soundness"]:checked');
                if (Soundness.length == 0) {
                    $('input:radio[name="Soundness"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="Soundness"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="Soundness"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                var LinguisticQuality = $('input:radio[name="LinguisticQuality"]:checked');
                if (LinguisticQuality.length == 0) {
                    $('input:radio[name="LinguisticQuality"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="LinguisticQuality"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="LinguisticQuality"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                var resolution = $('#tarresolution').val();
                if (resolution.replace('\r\n', '') == '') {
                    $('#tarresolution').parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('#tarresolution').focus();
                    return false;
                }
                else {
                    $('#tarresolution').parent().children('span').remove();
                }

                var contribution = $('#tarcontribution').val();
                if (contribution.replace('\r\n', '') == '') {
                    $('#tarcontribution').parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('#tarcontribution').focus();
                    return false;
                }
                else {
                    $('#tarcontribution').parent().children('span').remove();
                }

                var originalless = $('#taroriginalless').val();
                if (originalless.replace('\r\n', '') == '') {
                    $('#taroriginalless').parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('#taroriginalless').focus();
                    return false;
                }
                else {
                    $('#taroriginalless').parent().children('span').remove();
                }

                var verdict = $('input:radio[name="verdict"]:checked');
                if (verdict.length == 0) {
                    $('input:radio[name="verdict"]:eq(0)').parent().parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                    $('input:radio[name="verdict"]:eq(0)').focus();
                    return false;
                }
                else {
                    $('input:radio[name="verdict"]:eq(0)').parent().parent()
                        .children('span').remove();
                }

                if (verdict.val() > 1) {
                    var verdictcontent = $('#tarverdictcontent').val();
                    if (verdictcontent.replace('\r\n', '') == '') {
                        $('#tarverdictcontent').parent().append(
                        $('<span generated="true" style="color:red;">required.</span>')
                    );
                        $('#tarverdictcontent').focus();
                        return false;
                    }
                    else {
                        $('#tarverdictcontent').parent().children('span').remove();
                    }
                }
                var file = $('input:file[name="examineSheet"]').val();
                if (file != '') {
                    if (!/\.pdf$|\.doc$|\.docx$|\.rar$|\.zip$|\.7z$/i.test(file)) {
                        $('input:file[name="examineSheet"]').parent().append(
                            $('<span generated="true" style="color:red;">only pdf、doc、docx、rar、zip、7z .</span>')
                        );
                        $('input:file[name="examineSheet"]').focus();
                        return false;
                    }
                }

                if ($('#fleExamineSheet').val().length > 0) {
                    $('#btnsubmit').attr('disabled', 'disabled').val('附件上传中');
                }
                return true;
            });
        });
    </script>
}
